export default {
  tid: null,
  refresh() {
    const user = document.getElementById('app-account');
    const userMaxHeight = user.offsetWidth * (9 / 16);
    const winHeight = window.innerHeight;
    if (winHeight > userMaxHeight) {
      user.style.height = `${userMaxHeight}px`;
    } else {
      user.style.height = `${winHeight}px`;
    }
  },
  run() {
    clearTimeout(this.tid);
    this.tid = setTimeout(this.refresh, 250);
  },
};
